<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width">
    <title>单页列表</title>
    {include file="public/resource/layui_css" /}
</head>
<body>
<!-- 内容主体区域 -->
<div style="padding: 15px;">
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>单页列表</legend>
    </fieldset>
    <table class="layui-table"  lay-even>
        <thead>
        <tr>
            <th>ID</th>
            <th>标题</th>
            <th>添加时间</th>
            <th>管理</th>
        </tr>
        </thead>
        <tbody>
        {volist name='list' id='one'}
        <tr>
            <td>{$one.id}</td>
            <td><a href="/page/{notempty name='one.route'}{$one.route}{else/}{$one.id}{/notempty}.html" target="_blank">{$one.title}</a></td>
            <td>{$one.created_time}</td>
            <td>
                <div class="operate">
                    <a href="javascript:;" class="layui-btn layui-btn-xs" data-method="edit" lay-event="edit"
                       data-id="{$one.id}"><i class="layui-icon">&#xe642;</i></a>
                    <a href="javascript:;" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"
                       data-method="delete" data-id="{$one.id}" data-name="{$one.name}"><i
                            class="layui-icon">&#xe640;</i></a>

                </div>
            </td>
        </tr>
        {/volist}
        </tbody>
    </table>
    <div class="layui-row">
        <div id="page" align="right"></div>
    </div>
</div>
{include file="public/resource/layui_js" /}
<script type="text/javascript">
    let module = "page", moduleName= "页面", total = {$total} ,
        page = {$currentPage}, limit = 15;
    layui.use(['laypage'], function () {
        let laypage = layui.laypage;
        laypage.render({
            elem: 'page'
            , count: total
            , limit: limit
            , curr: page
            , layout: ['count', 'prev', 'page', 'next', 'limit', 'skip']
            , jump: function (obj) {
                if (obj.curr !== page || obj.limit !== limit) {
                    location.href =  '/admin/page?page=' + obj.curr + '&size=' + obj.limit;
                }
            }
        });
    });
</script>
<script src="/static/js/common.js"></script>
</body>
</html>